import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = 'DBshop007_查看销售管理发货单流程'

firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
# 1.点击销售管理发货单。
DBshopEnterMenu2(firefox, '销售管理', '发货单')
# 2.点击“查看”按钮，可以查看发货单已发货和未发货信息。
rootPath = get_pro_rootpath() # 获取项目的绝对路径
filePath = rootPath+r'\public\order1.txt' # 拼接文件路径
orderNo = readFile(filePath) # 读取文件中的订单编号
firefox.find_element_by_xpath('//td[text()="%s"]/following-sibling::td[5]/a' % orderNo).click()
time.sleep(4)
s = firefox.find_element_by_xpath("//body").text
l = "订单号"+orderNo+"  "
r = "\)"
order_State = reGetString(s, l, r)
print(order_State)  # order_State 是实际值
yuqi = "已收货"  # 这是预期值
# 断言
if yuqi == order_State:
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试不通过" % testCase)
    getPhoto(firefox)
firefox.quit()


